<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
    <script>
        var userList = new Array();
        userList.push({username:"zhangsan",age:18});
        userList.push({username:"lisi",age:28});

        /*$.ajax({
            type:"POST",
            url:"${pageContext.request.contextPath}/user/quick15",
            data:JSON.stringify(userList),// 把一个数组转成JSON字符串
            contentType:"application/json;charset=utf-8"
        });*/

        // username=zhangsan&age=18
        // {username:"zhagnan",age:18}

        //$.get();
        /*$.ajaxSettings.contentType = "application/json;charset=utf-8";
        $.post("${pageContext.request.contextPath}/user/quick15",
            JSON.stringify(userList),function (data) {

            });*/

        $.post("${pageContext.request.contextPath}/user/test",
            {username:"li4"},function (data) {});

    </script>
</head>
<body>

</body>
</html>
